public class CourseDirectory {

    //  array to contain all courses attributed to the logged in user
    public Course courses[];

    public CourseDirectory()
	{
		courses = null;
	}
	
	public void setCourses(Course c [])
	{
		courses = c;
	}
	
	public Course [] getCourses()
	{
		return courses;
	}
	
	public Course getCourse(int cid)
	{
		int i;
		//search array for correct course
		for (i = 0; i < courses.length ;i++)
		{
			if(cid == courses[i].getCid())
				return courses[i];
		}
		System.out.println("Course not found!");
		return null;
	}
}
